<!--危改查询 申请记录-->
<template>
  <div id="wgsearch">
    <div style="padding: 4px">
      <van-search v-model="cqr" style="border-radius: 10px; height: 44px" background="#f7f8fa" placeholder="请输入产权人姓名检索"
        @search="onSearch" />
    </div>
    <ul class="listWrap" v-if="listData.length > 0">
      <li v-for="(item, index) in listData" :key="index" @click="listClick(item)">
        <p class="p1">
          <span style="float: left">{{ item.propertyPerson }}</span>
          <span style="float: right;">
            <van-button plain type="info" size="mini" @click="ApprovalProgress(item)">审批进度</van-button>
            <van-button plain type="info" size="mini" @click="ProcessDetails(item)">办理详情</van-button>
          </span>
        </p>
        <p class="p3">
          <span style="float: left">自建房排查编号：{{ item.checkNumber }}</span>
        </p>
        <p class="p3">
          <span style="float: left">当前阶段：{{ item.processNodeName }}</span>
          <span style="float: right">用户类型:{{ item.userTypeName }}</span>
        </p>
        <p class="p3">
          <span style="float: left">地址：{{ item.belongCity }} {{ item.belongCounty }} {{ item.belongTown }}
            {{ item.villageName }}</span>
        </p>
      </li>
    </ul>
    <ul v-else>
      <div style="height: 60vh; text-align: center; padding-top: 20vh">
        <div style="margin-bottom: 10px">
          <img src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/50.png" />
        </div>
        <div>暂无数据</div>
      </div>
    </ul>
    <!-- <ul class="listWrap">
      <li v-show="contentData.length > 0" v-for="(item, index) in contentData" @click="handle(item)" :key="index">
        <p class="p1">
          <span style="float: left">{{ item.propertyPerson }}</span>
          <span style="float: right">{{ item.checkNumber }}</span>
        </p>
        <p class="p3">
          <span style="float: left">所属乡镇：{{item.belongCity }} {{ item.belongCountry}} {{item.belongTown}} {{item.belongVillage}}</span>
        </p>
        <p class="p3">
          <span style="float: left">地址：{{ item.detailAddress?item.detailAddress:'暂无数据' }}</span>
        </p>
      </li>
      <div style="height: 60vh;text-align:center;padding-top: 20vh;" v-show="contentData.length == 0">
        <div style="margin-bottom: 10px;">
          <img src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/50.png">
        </div>
        <div>暂无数据</div>
      </div>
    </ul> -->
  </div>
</template>
<script>
import { FileServerProxy, personToDoListV2 } from "@/utils/api";
export default {
  name: "wgsearch",
  data() {
    return {
      cqr: "",
      listData: [
      ],
      contentData: []
    }
  },
  methods: {
    ApprovalProgress(item){
      this.$store.state.wgxxInfo = JSON.stringify(item)
      this.$router.push({
        path: '/ApprovalProgress',
        query:{
          data: JSON.stringify(item)
        }
      })
    },
    ProcessDetails(item){
      this.$store.state.wgxxInfo = JSON.stringify(item)
      this.$router.push({
        path: '/ProcessDetails',
        query:{
          data: JSON.stringify(item)
        }
      })
    }, 
    onSearch() {
      this.getListData()
    },
    getListData: async function () {
      debugger
        // window.localStorage.getItem('DanDianid')
        let params = {
          "householderIdCard": window.localStorage.getItem('DanDianid'),
          "pageNo": 1,
          "pageSize": 1000,
          "userName": this.cqr,
          "useType": 1
        };
        const res = await personToDoListV2(params);
        console.log(res)
        if (res.data.data && res.data.data.pageList.length > 0) {
          this.listData = res.data.data.pageList
        } else {
          this.listData = [];
        }


    },
    //获取申请记录数据
    // getdata: async function () {
    //   this.contentData = [];
    //   debugger
    //   const restoListUser = await getApplyPersonInfoByIdCardV2(window.localStorage.getItem('DanDianid'));
    //   if (restoListUser.data && restoListUser.data.data.length > 0) {
    //     this.contentData = restoListUser.data.data;
    //   }
    // },
    // handle(data) {
    //   debugger
    //   if (data) {
    //     this.$router.push({
    //       path: '/KeyLineWG',
    //       query: { objtctNo: data.objectNo },
    //     })
    //   } else {
    //     this.$toast.fail('暂无环节信息');
    //     // this.$notify({ type: 'warning', message: '暂无环节信息' });
    //   }
    // }
  },
  mounted() {
    debugger
    this.getListData();
  }
}
</script>
<style lang='scss' scoped>
#wgsearch {
  height: 100%;
  overflow: auto;
  font-family: "Helvetica Neue", Helvetica, STHeiTi, sans-serif;
}
</style>

